﻿/** \file
* \$Rev: 184 $
* 
* \$Date: 2010-04-14 07:18:41 +0000 (Wed, 14 Apr 2010) $
*
* \$URL: http://chorus-twitter.googlecode.com/svn/trunk/src/gui/UserForm.cs $
*/

using System;
using System.Windows.Forms;
using chorus.twitter;

namespace chorus.gui
{
	/// <summary>
	/// A form to display a (not necessarily authenticating) user.
	/// </summary>
	public partial class UserForm : Form
	{
		/// <summary>The user to display.</summary>
		user user;

		/// <summary>The constructor.</summary>
		/// <param name="user">The user to display.</param>
		public UserForm(user user)
		{
			InitializeComponent();
			this.user = user;
			bindingUser.DataSource = user;

			checkGeo.DataBindings[0].FormattingEnabled = false;
			checkProtected.DataBindings[0].FormattingEnabled = false;
			checkVerified.DataBindings[0].FormattingEnabled = false;
		}

		/// <summary>Fired when a link label is clicked.</summary>
		/// <param name="sender">The event sender.</param>
		/// <param name="e">The event parameters.</param>
		void link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			string link = sender == linkLocation ? user.MapLink : ((LinkLabel)sender).Text;
			System.Diagnostics.Process.Start(link);
		}
	}
}
